#ifndef ORIGINALFORM_H
#define ORIGINALFORM_H
#include <QWidget>
#include <QFormLayout>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QPushButton>
#include <QGridLayout>
#include <QToolButton>
#include <QWidgetAction>
#include <QLineEdit>
#include <QLabel>
#include <QRadioButton>
#include <QScrollArea>
#include <metaparser.h>

class OriginalForm : public QWidget
{
public:
    OriginalForm(QWidget *parent = 0);

private:
    QFormLayout *fLayout;
    QHBoxLayout *bottomLayout;
    QVBoxLayout *mainLayout;
    QGridLayout *histLayout, *newAttrLayout;
    void initBasicUI();
    void initSlots();
    void operationDialog();

public slots:
    void chooseFolderAction();
    void genAttrAction();
    void genHistAction();
    void genMetadataAction();
    void clearMetadataAction();
    void delAttrAction();
    void delHistAction();

public:
    QPushButton *basePathBtn, *addNewAttrBtn, *addHistBtn, *okBtn, *clearBtn;
    QPushButton *delNewAttrBtn, *delHistBtn;
    QToolButton *originPathBtn;
    QLineEdit *title, *instruments, *creator, *creationDate,
                *type, *format, *origin, *commentsAll, setComments;
//    QLineEdit  *newKey, *newValue, *updatedTime, *updatedUser, *changes;
    QLabel *titleLabel, *intstLabel, *creatorLabel, *dateLabel, *locationLabel;
    QLabel *setLabel, *typeLabel, *formatLabel, *originLabel, *comAllLabel, *comSetsLabel;
    QLabel *addNewAttrLabel, *histLabel;
//    QLabel *newKeyLabel, *newValueLabel, *updatedTimeLabel, *updatedUserLabel, *changeLabel;
    QWidgetAction *choosePathAction;
    QList<QLineEdit*> *keyList, *valueList;
    QList<QLineEdit*> *creatorHistList, *changesHistList;
    QList<QDateTime> *histTimerList;

//    QRadioButton *rawRadioBtn, *trainRadioBtn, *testRadioBtn;
    static const int CREATE = 100, OVERWRITE = 200, UPDATE = 300;
    int optCode = 0;
    MetaParser *parser;
};

#endif // ORIGINALFORM_H
